<template>
  <div>
    <h3>案例查询</h3>
    <el-card>
      <div>
        <el-form ref="form" :model="queryForm" inline label-position="top">
          <el-form-item label="机构名称" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入机构名称" clearable></el-input>
          </el-form-item>
          <el-form-item label="机构代码" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入机构代码" clearable></el-input>
          </el-form-item>
          <el-form-item label="差异报告编码" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入差异报告编码" clearable></el-input>
          </el-form-item>
          <el-form-item label="办理状态">
            <el-select v-model="queryForm.status" size="small" placeholder="请选择办理状态" clearable>
              <el-option label="办理中" value="1"></el-option>
              <el-option label="已办结" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="案例报告编码" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入案例报告编码" clearable></el-input>
          </el-form-item>
          <el-form-item label="统一社会信用代码" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入统一社会信用代码" clearable></el-input>
          </el-form-item>
          <el-form-item label="备案主体名称" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入备案主体名称" clearable></el-input>
          </el-form-item>
          <el-form-item label="办理机构" prop="">
            <el-input v-model="queryForm.orgName" size="small" placeholder="请输入办理机构" clearable></el-input>
          </el-form-item>
          <el-form-item label="提交时间" prop="">
            <el-date-picker
              size="small"
              v-model="time"
              type="daterange"
              range-separator="至"
              start-placeholder="提交开始"
              end-placeholder="提交结束"
              clearable
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="办结时间" prop="">
            <el-date-picker
              size="small"
              v-model="time"
              type="daterange"
              range-separator="至"
              start-placeholder="办结开始"
              end-placeholder="办结结束"
              clearable
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="" style="padding-top: 24px">
            <el-button size="mini" type="primary" icon="el-icon-search">查询</el-button>
            <el-button size="mini" type="primary" plain icon="el-icon-refresh">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :data="tableDatas"
          style="width: 100%"
          border
          class="table-box"
          :header-cell-style="{ background: '#fff', color: '#333' }"
        >
          <el-table-column label="序号" width="100">
            <template slot-scope="scope">
              {{ (queryForm.page - 1) * queryForm.size + scope.$index + 1 }}
            </template>
          </el-table-column>
          <el-table-column prop="caseCode" label="案例报告编码" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="diffCode" label="差异报告编码" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="companyCode" label="统一社会信用代码" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="bodyName" label="备案主体名称" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="orgCode" label="提交机构编码" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="orgName" label="提交机构名称" width="140" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="status" label="办理状态" width="120" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="startTime" label="提交时间" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="handOrg" label="办理机构" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="endTime" label="办结时间" width="160" show-overflow-tooltip> </el-table-column>
          <el-table-column prop="prop" label="操作" width="100" fixed="right">
            <template slot-scope="{ row }">
              <el-button type="text" icon="el-icon-view" @click="viewDetail(row)">查看</el-button>
              <!-- <el-button type="text" @click="editItem(row)">修改</el-button>
              <el-button type="text" @click="deleteItem(row)">删除</el-button> -->
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryForm.page"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="queryForm.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          class="pagination"
        />
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'CaseSearch',

  data() {
    return {
      tableDatas: [
        {
          caseCode: 'CA202508080001',
          diffCode: 'QB202508080001',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080002',
          diffCode: 'QB202508080002',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080003',
          diffCode: 'QB202508080003',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080004',
          diffCode: 'QB202508080004',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080005',
          diffCode: 'QB202508080005',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080006',
          diffCode: 'QB202508080006',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080007',
          diffCode: 'QB202508080007',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080008',
          diffCode: 'QB202508080008',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080009',
          diffCode: 'QB202508080009',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
        {
          caseCode: 'CA202508080010',
          diffCode: 'QB202508080010',
          companyCode: '914301003388567',
          bodyName: '世瑞科技股份有限公司',
          orgCode: '914301003388567',
          orgName: '华南科技股份有限公司',
          status: '审批通过',
          startTime: '2025-08-18 15:35:35',
          handOrg: '华南科技股份有限公司',
          endTime: '2025-08-18 15:35:35',
        },
      ],
      queryForm: {
        orgName: '',
        orgCode: '',
        diffCode: '',
        status: '',
        caseCode: '',
        companyCode: '',
        bodyName: '',
        handOrg: '',
        submitTime: [],
        completeTime: [],
        page: 1,
        size: 10,
      },
      total: 0,
      time: [],
    }
  },
  created() {
    this.total = this.tableDatas.length
  },
  mounted() {},

  methods: {
    viewDetail(row) {
      sessionStorage.setItem('diffInfo',JSON.stringify(row))
      this.$router.push({
        path: '/case/casedetail',
        query: {
          diffcode: row.diffCode,
        },
      })
    },
    handleSizeChange(val) {},
    handleCurrentChange(val) {},
  },
}
</script>
<style lang="scss" scoped>
.pagination {
  text-align: right;
  margin-top: 12px;
}
::v-deep .el-range-editor--small.el-input__inner,::v-deep .el-input--small .el-input__inner {
  width: 222px;
}
::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-form-item__label {
  padding: 0;
  line-height: 24px;
}
</style>